 <#import "../../macro/macro.ftl" as m>
  <script type="text/javascript">
	 $(function(){
	 	$("#userrolepermitTree").tree({
	        url : '${user_path}/getAllRoleByUser?userId=${userId}',
	        checkbox: true,
	        animate:true,
	        lines:true,
	        cascadeCheck:true,
	        onCheck : function(node,checked) {
	        		var mdata={};
	        		var selectstr=new Array();
	        		var nodes = $('#userrolepermitTree').tree('getChecked',['checked','indeterminate']);
		        	for(var i=0;i<nodes.length;i++){
		        		selectstr.push(nodes[i].id);
		        	}
		        	var url="${user_path}/role/relation";
	        		mdata.userId="${userId}";
	        		mdata.roleId=selectstr;
	        		commitAjax(url,mdata);
	        }
		 });
	 })
 </script>
 <ul id="userrolepermitTree"></ul>